<% provide(:title, "用户管理界面") %>

<table class="table">
  <thead>
  <tr>
    <th>序号</th>
    <th>标题名</th>
    <th colspan="2"></th>
  </tr>
  </thead>

  <tbody>
  <% cache @categories do %>
    <% @categories.each do |category| %>
      <% cache category do %>
        <tr>
          <td><%= category.id %></td>
          <td><%= category.name %></td>
          <td><%= button_to '修改', edit_category_path(id: category.id), method: :get,
                            class: "btn btn-primary" %></td>
          <td><%= button_to '删除', category, method: :delete, data: {confirm: "你确定?"},
                            class: "btn btn-danger" %></td>
        </tr>
      <% end %>
    <% end %>
  <% end %>
  </tbody>
</table>

<div class="digg_pagination">
  <%= will_paginate @categories, :container => false %>
</div>